#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(void) 
{
    char input[256];
    char command[256];
    char *playme = NULL;
    char *playme2 = NULL;
    while (1==1) {
		scanf("%s",input);
		if (input != NULL) {
			if (strcmp ("ICY-META:",input) != 0) {
				playme = strtok( input, "=" );
				if (strcmp ("StreamTitle",playme) == 0) {
					playme = strtok( NULL, "=");
					playme2 = strtok(playme,";");
					//printf("SQUAGE-STREAM: #%s#\n",playme2);
					if (strcmp ("'",playme2) != 0) {
						printf("Playing %s\n",playme2);
						sprintf(command,"mplayer %s >/dev/null 2>&1 &",playme2);
						system(command);
					}
				}
			}
		}
    }
}
